Xceed Ultimate ListBox for Silverlight Documentation
Sorting Data

The data that is contained in a listbox can be sorted in both ascending and descending order through the use of SortDescriptions objects. Each sort description that is added to the SortDescriptions collection, defined on the ListBox class, represents one of the possible sort criteria that can be applied to a listbox's data.

<sllb:ListBox.SortDescriptions>
   <!--The "s" alias references the System.ComponentModel namespace in the 
          System.Windows assembly
          xmlns:s="clr-namespace:System.ComponentModel;assembly=System.Windows"-->
   <s:SortDescription PropertyName="ShipCountry"/>
   <s:SortDescription PropertyName="ShipCity" Direction="Descending"/>
</sllb:ListBox.SortDescriptions>

Whenever PropertyGroupDescription instances are added to GroupDescriptions, the data will be sorted in ascending order based on the PropertyName; however, a SortDescription object will not be added to the SortDescriptions collection.

 

 


Copyright Xceed Software Inc

Send Feedback